#[macro_export]
macro_rules! sock_to_sock {
    ($sock_a:expr,$sock_b:expr) => {
        spawn(move || {
        let mut buf = [0; 1024*1024];
        loop {
            let n = $sock_a.read(&mut buf).unwrap();
            debug!("read remote bytes {}", n);
            if n == 0 {
                break;
            }
            $sock_b.write_all(&buf[..n]).unwrap();
        }
    });
    };
}